<?php
echo $header;
echo $column_left;
echo $column_right;
$width_content = '98%';
if (($column_left) && ($column_right)) {
    $width_content = '48%';
} elseif (($column_left) || ($column_right)) {
    $width_content = '73%';
}
?>
<div class="content" style="width:<?php echo $width_content; ?>"><?php echo $content_top; ?>
    <div class="breadcrumb">
        <?php foreach ($breadcrumbs as $breadcrumb) { ?>
            <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
        <?php } ?>
    </div>
    <ul data-role="listview" data-divider-theme="a" data-inset="true">
        <li data-role="list-divider"><h1><?php echo $heading_title; ?></h1></li>
    </ul><br />
    <?php if ($error_warning) { ?>
        <div class="warning"><?php echo $error_warning; ?></div>
    <?php } ?>
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="voucher">
        <div class="form" data-role="fieldcontain"><ul data-role="listview" data-divider-theme="a" data-inset="true">
                <li data-role="list-divider"><?php echo $text_description; ?></li>
                <li>
                    <span class="required">*</span>
                    <input placeholder="<?php echo $entry_to_name; ?>" type="text" name="to_name" value="<?php echo $to_name; ?>" />
                    <?php if ($error_to_name) { ?>
                        <div class="error"><?php echo $error_to_name; ?></div>
                    <?php } ?>
                </li>
                <li>
                    <span class="required">*</span>
                    <input placeholder="<?php echo $entry_to_email; ?>" type="text" name="to_email" value="<?php echo $to_email; ?>" />
                    <?php if ($error_to_email) { ?>
                        <div class="error"><?php echo $error_to_email; ?></div>
                    <?php } ?>
                </li>
                <li>
                    <span class="required">*</span>
                    <input placeholder="<?php echo $entry_from_name; ?>" type="text" name="from_name" value="<?php echo $from_name; ?>" />
                    <?php if ($error_from_name) { ?>
                        <div class="error"><?php echo $error_from_name; ?></div>
                    <?php } ?>
                </li>
                <li>
                    <span class="required">*</span>
                    <input placeholder="<?php echo $entry_from_email; ?>" type="text" name="from_email" value="<?php echo $from_email; ?>" />
                    <?php if ($error_from_email) { ?>
                        <div class="error"><?php echo $error_from_email; ?></div>
                    <?php } ?>
                </li>
                <li>
                    <label for="message"><?php echo $entry_message; ?></label>
                    <textarea id="message" name="message" cols="40" rows="5"><?php echo $message; ?></textarea>
                </li>
                <li>
                    <span class="required">*</span> <label for="amount"><?php echo $entry_amount; ?></label>
                    <input type="text" name="amount" id="amount" value="<?php echo $amount; ?>" size="5" />
                    <?php if ($error_amount) { ?>
                        <div class="error"><?php echo $error_amount; ?></div>
                    <?php } ?>
                </li>
                <li>
                    <fieldset data-role="controlgroup">
                        <legend><span class="required">*</span> <?php echo $entry_theme; ?></legend>
                        <?php foreach ($voucher_themes as $voucher_theme) { ?>
                            <?php if ($voucher_theme['voucher_theme_id'] == $voucher_theme_id) { ?>
                                <input type="radio" name="voucher_theme_id" value="<?php echo $voucher_theme['voucher_theme_id']; ?>" id="voucher-<?php echo $voucher_theme['voucher_theme_id']; ?>" checked="checked" />
                                <label for="voucher-<?php echo $voucher_theme['voucher_theme_id']; ?>"><?php echo $voucher_theme['name']; ?></label>
                            <?php } else { ?>
                                <input type="radio" name="voucher_theme_id" value="<?php echo $voucher_theme['voucher_theme_id']; ?>" id="voucher-<?php echo $voucher_theme['voucher_theme_id']; ?>" />
                                <label for="voucher-<?php echo $voucher_theme['voucher_theme_id']; ?>"><?php echo $voucher_theme['name']; ?></label>
                            <?php } ?>
                        <?php } ?>
                    </fieldset>
                    <?php if ($error_theme) { ?>
                        <div class="error"><?php echo $error_theme; ?></div>
                    <?php } ?>
                </li>
        </div>
        <div class="buttons">
            <div class="right"><label for="agree">&nbsp;</label><?php echo strtr($text_agree, array('<a' => '<a data-rel="dialog"')); ?>
                <?php if ($agree) { ?>
                    <input type="checkbox" id="agree" name="agree" value="1" checked="checked" />
                <?php } else { ?>
                    <input type="checkbox" id="agree" name="agree" value="1" />
                <?php } ?>
                <a data-role="button" onclick="$('#voucher').submit();" class="button"><span><?php echo $button_continue; ?></span></a>
            </div>
        </div>
    </form>
    <?php echo $content_bottom; ?>
</div>
<?php echo $footer; ?>